# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=oxyromon
pkgver=0.17.0
pkgrel=1
pkgdesc='Rusty ROM OrgaNizer'
arch=(loong64 x86_64)
url=https://github.com/alucryd/oxyromon
license=(GPL3)
depends=(
  gcc-libs
  glibc
)
makedepends=(
  cmake
  ctrtool
  dolphin-emu-tool
  git
  mame-tools
  maxcso
  p7zip
  rust
  yarn
)
optdepends=(
  'cdrtools: IRD support'
  'ctrtool: CIA support'
  'dolphin-emu-tool: RVZ support'
  'mame-tools: CHD support'
  'maxcso: CSO support'
  'p7zip: 7Z and ZIP support'
)
_tag=bb3bbae6cd326c25def0386f26ad1778c3a17665
source=(git+https://github.com/alucryd/oxyromon.git#tag=${_tag})
validpgpkeys=(95220BE99CE6FF778AE0DC670F65C7D881506130) # Maxime Gauduin <alucryd@archlinux.org>
b2sums=(SKIP)
options=(!lto)

prepare() {
  cd oxyromon
  yarn install \
    --frozen-lockfile
  cargo fetch \
    --locked
}

pkgver() {
  cd oxyromon
  git describe --tags
}

build() {
  cd oxyromon
  yarn build
  cargo build \
    --features benchmark,server \
    --release \
    --frozen
}

check() {
  cargo test \
    --features benchmark,server \
    --release \
    --frozen \
    --manifest-path oxyromon/Cargo.toml
}

package() {
  cargo install \
    --features benchmark,server \
    --frozen \
    --offline \
    --no-track \
    --path oxyromon \
    --root "${pkgdir}"/usr
}

# vim: ts=2 sw=2 et:
